//感谢易源上提供的api地址，免费的数据接口

// const _lyday = "http://route.showapi.com/907-4"

// const _lygoods = "http://route.showapi.com/907-2"

// const _lykind = "http://route.showapi.com/907-1"



let time = getTime()

export default {
    getlyday(){
        return  "http://route.showapi.com/907-4?showapi_appid=33790&showapi_timestamp="+time+"&showapi_sign=4453a300d157437a80ef933955a2e666"
    },
    getlygoods(cid,keyword){
        return  "https://route.showapi.com/907-2?showapi_appid=33792&cid="+cid+"&keyword="+keyword+"&showapi_timestamp="+time+"&showapi_sign=0a4dc9e7c14d4975a3a3b2d6557579ba"
    },
    getlykind(){
        return  "http://route.showapi.com/907-1?showapi_appid=33793&showapi_timestamp="+time+"&showapi_sign=252dd070e14f4442835b375ff24bc85a"
    },
    getnotice(){
        return "https://route.showapi.com/907-3?showapi_appid=33791&showapi_timestamp="+time+"&showapi_sign=41f42c9252464fda874b2fbcc133609e"
    },
    //手机详情
    getphonedetails(productId,flag){
        flag=(flag!=1?0:flag)
        return "https://route.showapi.com/908-3?needDesc="+flag+"&productId="+productId+"&showapi_appid=34212&showapi_timestamp="+time+"&showapi_sign=7e19e9adc4804b9abf57fc3faaa548a2"
    },
    
    //手机商品查询
    getphonesearch(q){
        // var q,brand,net,system,cpu,camera,price,page=''
        // var arr = [q,brand,net,system,cpu,camera,price,page]
        // for(var key in obj){

        // }
        return "https://route.showapi.com/908-2?brand=&camera=&cpu=&net=&page=&price=&q="+q+"&showapi_appid=34212&showapi_timestamp="+time+"&system=&showapi_sign=7e19e9adc4804b9abf57fc3faaa548a2"
    },
    //手机新闻

    getphonenews(){
      return "https://route.showapi.com/908-4?showapi_appid=34212&showapi_timestamp="+time+"&showapi_sign=7e19e9adc4804b9abf57fc3faaa548a2"
    },

    //
}
function getTime() {
    let num = new Date()
    let Month = num.getMonth()+1
    let Hours = num.getHours()
    let Minutes = num.getMinutes()
    let Seconds = num.getSeconds()
    let date = num.getDate()
    if(Month<10){
        Month='0'+Month 
    }
    if(Hours<10){
        Hours = '0'+Hours
    }
    if(Minutes<10){
        Minutes = '0'+Minutes
    }    if(Seconds<10){
        Seconds = '0'+Seconds
    }
    if(date<10){
        date = '0'+date
    }
    
    let time =num.getFullYear()+""+Month+date+Hours+Minutes+Seconds
    return time
}


// 今日团购:

// 	ID:33790
// 	秘钥：4453a300d157437a80ef933955a2e666

// 参数：showapi_appid32100showapi_timestamp20170316152508

// url：https://route.showapi.com/907-4?showapi_appid=32100&showapi_timestamp=20170316152329&showapi_sign=63ad97ec25469fe66282656134a885a4


// 商城公告查询:

// 	ID:33791
// 	秘钥：41f42c9252464fda874b2fbcc133609e

// 参数：showapi_appid32100showapi_timestamp20170316152457

// url：https://route.showapi.com/907-3?showapi_appid=32100&showapi_timestamp=20170316152344&showapi_sign=804fdef1b21da250861bf7cdd8108422


// 商品查询:

// 	ID:33792
// 	秘钥：0a4dc9e7c14d4975a3a3b2d6557579ba

// 参数：cid9209keyword背包page1showapi_appid32100showapi_timestamp20170316152352

// url：https://route.showapi.com/907-2?cid=9209&keyword=背包&page=1&showapi_appid=32100&showapi_timestamp=20170316152352&showapi_sign=0e0e7c207f4ee8c4716c01c79c603af3


// 类目查询:

// 	ID:33793
// 	秘钥：252dd070e14f4442835b375ff24bc85a

// 参数：showapi_appid32100showapi_timestamp20170316152516

// url：https://route.showapi.com/907-1?showapi_appid=32100&showapi_timestamp=20170318173902&showapi_sign=a204a3205201e45baa7db5c7e7fd71c5


//手机

// ID:34212
// 	秘钥：7e19e9adc4804b9abf57fc3faaa548a2

// 1.
//手机详情

// 参数：needDesc0 productId33368 showapi_appid32100showapi_timestamp20170324002741

// url: https://route.showapi.com/908-3?needDesc=0&productId=33368&showapi_appid=32100&showapi_timestamp=20170324002741&showapi_sign=7f72c317980c3e610df6732f5b7dfc90

// 2.
//手机商品查询

// 参数名称	类型	默认值	示例值	必须	描述
// q	    String			    否	关键词
// brand	String			    否	品牌id
// net	    String			    否	网络制式id
// system	String			    否	操作系统id
// cpu	    String			    否	cpu类型id
// camera	String			    否	后置摄像头id
// price	String			    否	价格类型
// page	    String			    否	第几页

//参数:showapi_appid32100showapi_timestamp20170324091457

//url: https://route.showapi.com/908-2?brand=&camera=&cpu=&net=&page=&price=&q=&showapi_appid=32100&showapi_timestamp=20170324091457&system=&showapi_sign=5cef6038e1e316168a4ae3c0c10dd385


//3.
// 参数列表

//参数: showapi_appid32100showapi_timestamp20170324152535

// url:https://route.showapi.com/908-1?showapi_appid=32100&showapi_timestamp=20170324152535&showapi_sign=89bf280a050385e459eb5eb395fdf6a5


// 4.公告新闻
// 参数 :showapi_appid32100showapi_timestamp20170324204416
// url:https://route.showapi.com/908-4?showapi_appid=32100&showapi_timestamp=20170324204416&showapi_sign=c964fb70181ab538b0494f2ba8e66c69


